<?php 
if (isset($_SESSION['daima'])){
    $code=$_SESSION['daima'];
}else{
    $code=rand(100,999);
    $_SESSION['daima']=$code;
}

?><!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
<title>2023上海市中学生现代文阅读素养活动</title>
<style>
html,body{font-size:16px;background:#f1f1f4;width:100%;font-size:12px;color:#fff;font-family:Microsoft YaHei, Gotham, "Helvetica Neue", Helvetica, Arial, sans-serif;}
body, div{position:relative;padding:0px;margin:0px auto;max-width:750px;}
.weui-dialog{position:fixed;z-index:5000;width:80%;max-width:300px;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);background-color:#FFF;text-align:center;border-radius:3px;overflow:hidden}.weui-dialog__hd{padding:1.3em 1.6em .5em}.weui-dialog__title{font-weight:400;font-size:18px}.weui-dialog__bd{padding:0 1.6em .8em;min-height:40px;font-size:15px;line-height:1.3;word-wrap:break-word;word-break:break-all;color:#999}.weui-dialog__bd:first-child{padding:1.2em 20px .1em;color:#353535}.weui-dialog__ft{position:relative;line-height:48px;font-size:18px;display:-webkit-box;display:-webkit-flex;display:flex}.weui-dialog__ft:after{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1px solid #D5D5D6;color:#D5D5D6;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleY(.5);transform:scaleY(.5)}.weui-dialog__btn{display:block;-webkit-box-flex:1;-webkit-flex:1;flex:1;color:#3CC51F;text-decoration:none;-webkit-tap-highlight-color:transparent;position:relative}.weui-dialog__btn:active{background-color:#EEE}.weui-dialog__btn:after{content:" ";position:absolute;left:0;top:0;width:1px;bottom:0;border-left:1px solid #D5D5D6;color:#D5D5D6;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-transform:scaleX(.5);transform:scaleX(.5)}.weui-dialog__btn:first-child:after{display:none}.weui-dialog__btn_default{color:#353535}.weui-dialog__btn_primary{color:#0BB20C}@media screen and (min-width:1024px){.weui-dialog{width:35%}}.weui-mask{position:fixed;z-index:1000;top:0;right:0;left:0;bottom:0;background:rgba(0,0,0,.6)}
.weui-mask_transparent{position:fixed;z-index:1000;top:0;right:0;left:0;bottom:0}
.js_dialog{display:none;}
.weui-toast {position: fixed;z-index: 5000;width: 7.6em;min-height: 7.6em;top: 180px;left: 50%;margin-left: -3.8em;background: rgba(17, 17, 17, 0.7);text-align: center;border-radius: 5px;color: #FFFFFF;}
.weui-loading {width: 20px;height: 20px;display: inline-block;vertical-align: middle;
animation: weuiLoading 1s steps(12, end) infinite;background: transparent url() no-repeat;background-size: 100%;}
@-webkit-keyframes weuiLoading {
    0% {
        transform: rotate3d(0, 0, 1, 0deg);
    }

    100% {
        transform: rotate3d(0, 0, 1, 360deg);
    }
}
@keyframes weuiLoading {
    0% {
        transform: rotate3d(0, 0, 1, 0deg);
    }

    100% {
        transform: rotate3d(0, 0, 1, 360deg);
    }
}
.weui-icon_toast.weui-loading {
    margin: 30px 0 0;
    width: 38px;
    height: 38px;
    vertical-align: baseline;
}
.weui-toast__content {
    margin: 0 0 15px;
}
-webkit-touch-callout:none;
-webkit-user-select:none;
html{-ms-touch-action:none;}
div,img{-webkit-tap-highlight-color:rgba(0,0,0,0);}
*{-webkit-text-size-adjust: none;}
.simg{position:absolute;display:block;}
a{text-decoration:none;}
.txt{position:absolute;text-indent:8px;font-size:12px;z-index:2;border:none;background:transparent;}
.txt::-webkit-input-placeholder {color:#58595b;text-align:left;}
select{position:absolute;display:block;background:transparent;border:0px;text-indent:8px;font-size:12px;-webkit-appearance:none;}
.container{position:relative;width:100%;height:auto;overflow:hidden;}
.p1, .p2{position:absolute;width:100%;height:100%;background:transparent url('<?php echo $cdnjsUrl; ?>/img/bg.jpg') no-repeat;background-size:cover;display:none;}
.fade-in{opacity:1;-webkit-transition:opacity 1s ease-in-out;-moz-transition: opacity 1s ease-in-out;-o-transition: opacity 1s ease-in-out;transition: opacity 1s ease-in-out;}
.p-bg{top:0px;left:0px;}
.t-bg{position:absolute;display:none;width:100%;height:100%;top:0px;left:0px;background-color:#000;opacity:.8;z-index:9;}
.tip{position:absolute;display:none;width:100%;height:100%;top:0px;left:0px;z-index:99;background-color:rgb(0,0,0,.8)}
.tipz-t1{position:absolute;width:100%;height:auto;background:transparent url('<?php echo $cdnjsUrl; ?>/img/tip-name.png') no-repeat;background-size:cover;}
.tipz-txt1, .tipz-txt2, .tipz-txt3{position:absolute;text-align:center;width:100%;height:auto;color:#686d71;font-size:12px;}
.tipz-txt2{font-weight:700;}
.p2-txt{position:absolute;font-size:13px;color:#000;}
.ltop, .lbotm, .l100{position:absolute;width:100%;left:0;display:block;}    
.ltop{top:0;}
.lbotm{bottom:0;}
.p2-box{position:absolute;width:100%;left:0;overflow-y: scroll;}  
.p2-li{position:relative;width:100%;background:transparent url('<?php echo $cdnjsUrl; ?>/img/p2-z2.png') no-repeat;background-size:cover;}
.p2-li2{position:relative;width:100%;text-align:center;margin-bottom:5px;}
.p2-li2 img{height:100%;}
.p2-gap{width:100%;height:40px;display:none;}
.weui-mask_transparent{background-color: rgb(0,0,0, 0.5);}
</style></head>
<body>
<div class="container">
  <div class="p1 page">
        <img class="ltop" src="<?php echo $cdnjsUrl; ?>/img/p1-b.png">
        <input id="p1-name" class="txt" name="p1-name" type="text" value="" placeholder="" />
        
        <div class="p1-jr simg"></div>
  </div>
  <div class="p2 page">
    <img class="p2-z1 l100" src="<?php echo $cdnjsUrl; ?>/img/p2-z1.png">
    <div class="p2-box">
      
     <div class="p2-li">
        <div class="p2-name p2-txt"></div>
        <div class="p2-qu p2-txt"></div>
        <div class="p2-school p2-txt"></div>
        <div class="p2-nianji p2-txt"></div>
        <div class="p2-kaoc p2-txt"></div>  
      </div>
      <div class="p2-li2">
          <img  src="<?php echo $cdnjsUrl; ?>/img/p2-btn.png">
      </div>
  
      <div class="p2-gap"></div>
        
    </div>   
      
  </div>    
    
    
  <div class="tip">
      <div class="tipz-t1">
          <div class="tipz-close simg"></div>
          <div class="tipz-txt1">您填写的姓名并未查询到参赛信息</div>
          <div class="tipz-txt2">请核实后重新填写</div>
          <div class="tipz-txt3">或者联系主办方：021-60319027  吴老师</div>
      
      </div>
  </div>
  <div class="t-bg"></div>
  
  <div class="js_dialog">
       <div class="weui-mask"></div>
       <div class="weui-dialog">
                <div class="weui-dialog__bd weui-msg"></div>
                <div class="weui-dialog__ft">
                    <a href="javascript:;" class="weui-dialog__btn weui-dialog__btn_primary weui-btn">知道了</a>
                </div>
        </div>
  </div>
  <div id="loadingToast" style="display:none;">
        <div class="weui-mask_transparent"></div>
        <div class="weui-toast">
            <i class="weui-loading weui-icon_toast"></i>
            <p class="weui-toast__content">照片上传中中</p>
        </div>
  </div>
  
</div>
<script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="./js/jquery.uploadfile.min.js"></script>
    
<script>
_h=h= Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
var sWidth = parseInt((window.innerWidth > 0) ? window.innerWidth : screen.width);
if(sWidth>750){sWidth=750;}
var _rate=(sWidth/750);
if(h<_rate*1334){
	h=_rate*1334;
}
var _isUpA=false;
var _isUpB=false;
$(function(){
	$(".p1").show().addClass("fade-in");
	$('.container, .page').width(sWidth).height(h);
	$('.p-bg').width(sWidth).height(_rate*1334);
	$('#p1-name').width(_rate*312).height(_rate*62).css({"top":_rate*840, "left":_rate*296});
    
	$('.p1-jr').width(_rate*320).height(_rate*100).css({"top":_rate*1000, "left":_rate*214});
    
    
    
	$('.tipz-t1').width(_rate*640).height(_rate*194).css({"top":_rate*500, "left":0});
	$('.tipz-txt1').css({"top":_rate*54});
	$('.tipz-txt2').css({"top":_rate*92});
	$('.tipz-txt3').css({"top":_rate*132});
	$('.tipz-close').width(_rate*80).height(_rate*60).css({"top":0, "right":_rate*50});
    
    $('.p2-z1').css({"top":0});
    var _tmpH=h - _rate*200;
    if(_tmpH < _rate*780){
        _tmpH=_rate*780;
    }
    $('.p2-box').height(_tmpH).css({"top":_rate*190});
   
    
    function _initp2(){
        $('.p2-li').height(_rate*546);
        $('.p2-li2').height(_rate*130);
        $('.p2-txt').height(_rate*56).css({"left":_rate*274,'lineHeight':_rate*56+'px'});
        $('.p2-name').css({"top":_rate*24});
        $('.p2-qu').css({"top":_rate*133});
        $('.p2-school').css({"top":_rate*242});
        $('.p2-nianji').css({"top":_rate*352});
        $('.p2-kaoc').css({"top":_rate*460});
    }
    
    
    
    
    
    
    //$(".p1").hide();
   // $(".p2").show().addClass("fade-in");
    


	$('.tipz-close').click(function(){
		$(".t-bg, .tip").hide();
	});
	$('.p1-jr').click(function(){
		var _name=$("#p1-name").val();
        if('' == _name){
       		$(".weui-msg").html("请填写学生姓名");
            $(".js_dialog").show();
            return;  
        }
        $.post("./api/?c=user", {name:_name}, function(data){
			 if('ok' == data.status){
                 var _html='';
                 for(var i=0;i<data.u.length;i++){
                     _html+='<div class="p2-li"><div class="p2-name p2-txt">'+data.u[i]['name']+'</div><div class="p2-qu p2-txt">'+data.u[i]['qu']+'</div><div class="p2-school p2-txt">'+data.u[i]['school']+'</div><div class="p2-nianji p2-txt">'+data.u[i]['nianji']+'</div><div class="p2-kaoc p2-txt">'+data.u[i]['kc']+'</div></div>';
                      _html+='<div class="p2-li2"><img data-id="'+data.u[i]['id']+'" src="<?php echo $cdnjsUrl; ?>/img/p2-btn.png"></div>';
                 }
                 $(".p2-box").html(_html);
                 console.log(data);
                 _initp2();
                $(".p1").hide();
                $(".p2").show();
                $(".p2-li2 img").click(function(){
                    var _id=$(this).attr("data-id");
                    window.location.href="?c=info&id="+_id;
                }); 
                 
		     }else{
                $(".tip").show();
                //$(".weui-msg").html("姓名不存在");
                //$(".js_dialog").show();
                return;  
			 }
		}, "json");
	});
	
  if(!('placeholder' in document.createElement('input')) ){   
	    $('input[placeholder],textarea[placeholder]').each(function(){var that = $(this),text= that.attr('placeholder');   
	      if(that.val()===""){that.val(text).addClass('placeholder');}   
	      that.focus(function(){if(that.val()===text){that.val("").removeClass('placeholder');}})   
	      .blur(function(){if(that.val()===""){that.val(text).addClass('placeholder');}})   
	      .closest('form').submit(function(){   
	        if(that.val() === text){that.val('');}});});   
	}
	$(".weui-btn").click(function(){
        $(".js_dialog").hide();
	});
});
</script>
</body>
</html>